import { createSlice } from "@reduxjs/toolkit";
// 创建仓库片段
const theme = createSlice({
    // 设置片段的事件代号
    name:"theme",
    // 设置状态初始值
    initialState:{
        theme:true,
        isLoading:true
    },
    // 设置
    reducers:{
        changeTheme(state,action){
            state.theme = action.payload
        },
        changeLoading(state,action){
            state.isLoading = action.payload
        }
    }
})

export const {changeTheme,changeLoading } = theme.actions

export default theme.reducer